
#include "DYSvrNetMan.h"

static int exit_server = 0;
void sig_handle(int signum, siginfo_t *siginfo, void* context)
{
	exit_server = 1;
	return ;    
}

int main(int argc , char *argv[])
{
	/* Parse command line arguments  */
	if (!parseArg(argc, argv, &param)) 
	{
		usage();
		return 0;
	}

	struct sigaction sig_act;
    
	sig_act.sa_flags = SA_SIGINFO;
	sig_act.sa_sigaction = sig_handle;
	sigaction(SIGINT, &sig_act, NULL); 
	sigaction(SIGTERM, &sig_act, NULL); 


	DYSvrNetMan xNetSvrMan;
	xNetSvrMan.SetConnectTime( 5000,10 );
	xNetSvrMan.SetListen( 9000,9001,9002 );

	xNetSvrMan.SvrStart();


	printf("\n**Hit any key to exit");
	while(!_kbhit()) Sleep (100);
	
    xNetSvrMan.SvrStop();

	return 0 ;
}
